-
Notifications
You must be signed in to change notification settings - Fork 259
chore(datastore): added unit tests for Amplify Api Native Bridge #4983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Unit tests for Query, Mutate, Subscribe, and Unsubscribe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice job so far!
group('NativeAmplifyAPI', () { | ||
group('Query', () { | ||
test('Should handle empty request/response', () async { | ||
String document = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: DataStore doesn't follow amplify lints, but just an fyi in other packages where amplify_lints using final is enforced for local vars that are not mutated. The same probably applies to other lint rules.
I am going to see how much work enable amplify_lints in datastore will be. If/when it is added these are updates dart fix will make automatically.
You don't need to update these. Just wanted to make a note.
return GraphQLOperation<String>( | ||
CancelableOperation<GraphQLResponse<String>>.fromValue( | ||
GraphQLResponse<String>( | ||
data: data as String?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The fact that this is making you cast to String?
is odd. I think this is a bug in Dart. I created a minimal repro of this and opened an issue: dart-lang/sdk#55958
* chore(datastore): added unit tests for Amplify Api Native Bridge Unit tests for Query, Mutate, Subscribe, and Unsubscribe * chore(datastore): updated Amplify Api Native Bridge unit tests per feedback * chore(datastore): Formatted file
* chore(datastore): added unit tests for Amplify Api Native Bridge Unit tests for Query, Mutate, Subscribe, and Unsubscribe * chore(datastore): updated Amplify Api Native Bridge unit tests per feedback * chore(datastore): Formatted file
* chore(datastore): added unit tests for Amplify Api Native Bridge Unit tests for Query, Mutate, Subscribe, and Unsubscribe * chore(datastore): updated Amplify Api Native Bridge unit tests per feedback * chore(datastore): Formatted file
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.